﻿<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="QuanLyMuc.aspx.cs" Inherits="ThuChi.QuanLyMuc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">


        .style16
        {
            text-align: center;
        }
        .style21
        {
        }
        .style23
        {
            width: 400px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server" />
    <asp:LinqDataSource ID="LinqDataSourceMuc" runat="server" 
        ContextTypeName="ThuChi.DCThuChiDataContext" EntityTypeName="" 
        TableName="Mucs" 
        Where="MaTaiKhoan == @MaTaiKhoan &amp;&amp; MaKhoan== @MaKhoan" 
        EnableUpdate="True" EnableDelete="True" EnableInsert="True" 
        onselecting="LinqDataSourceMuc_Selecting">
        <InsertParameters>
            <asp:SessionParameter DefaultValue="0" Name="MaTaiKhoan" 
                SessionField="MaTaiKhoan" Type="Int32" />
            <asp:ControlParameter ControlID="cboKhoanFilter" DefaultValue="0" 
                Name="MaKhoan" PropertyName="SelectedValue" Type="Int32" />
        </InsertParameters>
        <WhereParameters>
            <asp:SessionParameter DefaultValue="0" Name="MaTaiKhoan" 
                SessionField="MaTaiKhoan" Type="Int32" />
            <asp:ControlParameter ControlID="cboKhoanFilter" DefaultValue="0" 
                Name="MaKhoan" PropertyName="SelectedValue" Type="Int32" />
        </WhereParameters>
    </asp:LinqDataSource>
    <asp:LinqDataSource ID="LinqDataSourceKhoan" runat="server" 
        ContextTypeName="ThuChi.DCThuChiDataContext" EntityTypeName="" 
        TableName="Khoans">
    </asp:LinqDataSource>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
    <ProgressTemplate>
    <div align="center" style="background-color: #FFFAFA">
        <img alt="" src="App_Images/loading_icon%20(2).gif" align="middle" />
    </div>
    </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <table align="center" border="1px" cellpadding="4" 
        style="border: thin solid #dbddff; width: 100%;" bgcolor="Snow">
        <tr>
            <td class="style16" colspan="2">
                <strong>QUẢN LÝ MỤC DIỄN GIẢI</strong></td>
        </tr>
        <tr>
                <td class="style21" style="border: 2px solid #dbddff;" colspan="2">
                    <strong style="font-size: 14px">Loại khoản: </strong>
                    <asp:DropDownList ID="cboKhoanFilter" runat="server" AutoPostBack="True" 
                        Width="135px" 
                        Height="20px" 
                        style="margin-left: 0px" Font-Size="13px" 
                        DataSourceID="LinqDataSourceKhoan" DataTextField="TenKhoan" 
                        DataValueField="MaKhoan">
                    </asp:DropDownList>
                </td>
        </tr>
        <tr>
            <td style="border: 2px solid #dbddff;" valign="top" class="style23">
                    <asp:DetailsView ID="DetailsViewMuc" runat="server" AutoGenerateRows="False" 
                        BorderColor="#DBDDFF" BorderStyle="Solid" BorderWidth="2px" CellPadding="4" 
                        CellSpacing="2" DataKeyNames="MaDoiTac" DataSourceID="LinqDataSourceMuc" 
                        DefaultMode="Insert" Height="50px" 
                        oniteminserted="DetailsViewMuc_ItemInserted" Width="100%">
                        <Fields>
                            <asp:BoundField DataField="TenMuc" HeaderText="Tên mục" 
                                SortExpression="TenMuc">
                            <ControlStyle Width="99%" />
                            <HeaderStyle ForeColor="Blue" Width="50px" Wrap="False" />
                            <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
                            </asp:BoundField>
                            <asp:CommandField CancelText="Hủy bỏ" InsertText="Thêm" 
                                ShowInsertButton="True" />
<asp:DynamicField HeaderText="MaTaiKhoan" ReadOnly="True" DataField="MaTaiKhoan" Visible="False"></asp:DynamicField>
                            <asp:DynamicField DataField="MaKhoan" HeaderText="MaKhoan" ReadOnly="True" 
                                Visible="False" />
                        </Fields>
                        <HeaderStyle Wrap="True" />
                        <InsertRowStyle BorderColor="Lavender" BorderStyle="Solid" BorderWidth="1px" />
                        <RowStyle BorderColor="#DBDDFF" BorderStyle="Solid" BorderWidth="1px" />
                    </asp:DetailsView>
                </td>
            <td style="border: 2px solid #dbddff;" valign="top">
                    <asp:Label ID="lblErrorMessage" runat="server" ForeColor="#FF3300" Width="100%" 
                        style="margin-left: 0px" Height="64px"></asp:Label>
                </td>
        </tr>
        <tr>
            <td colspan="2" style="border: 2px solid #dbddff;">
    <asp:GridView ID="grvMuc" runat="server" AllowPaging="True" Width="100%" 
        AllowSorting="True" AutoGenerateColumns="False" CellPadding="6" 
        CssClass="DDGridView" 
        EnableModelValidation="False" 
        ShowFooter="True" ShowHeaderWhenEmpty="True" DataKeyNames="MaMuc" 
        DataSourceID="LinqDataSourceMuc" onrowdatabound="grvMuc_RowDataBound" 
                    onrowdeleted="grvMuc_RowDeleted" onprerender="grvMuc_PreRender">
        <Columns>
            <asp:CommandField CancelText="Hủy bỏ" DeleteText="Xóa" EditText="Sửa" 
                ShowDeleteButton="True" ShowEditButton="True" UpdateText="Cập nhật">
            <FooterStyle Wrap="False" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="100px" 
                Wrap="False" />
            </asp:CommandField>
<asp:BoundField DataField="TenMuc" HeaderText="Mục diễn giải" 
                SortExpression="TenMuc" >
            <ItemStyle Width="300px" Wrap="False" />
            </asp:BoundField>
            <asp:BoundField DataField="Ton" HeaderText="Tồn" 
                SortExpression="Ton" DataFormatString="{0:N0}" ReadOnly="True" >
            </asp:BoundField>
        </Columns>
        <FooterStyle CssClass="DDFooter" />
        <HeaderStyle HorizontalAlign="Center" CssClass="th" />
        <PagerSettings FirstPageImageUrl="~/DynamicData/Content/Images/PgFirst.gif" 
            FirstPageText="" LastPageImageUrl="~/DynamicData/Content/Images/PgLast.gif" 
            LastPageText="" Mode="NumericFirstLast" NextPageText="" PageButtonCount="8" 
            PreviousPageText="" />
        <PagerStyle CssClass="DDPager" />
        <RowStyle CssClass="td" />
    </asp:GridView>
                </td>
        </tr>
        <tr>
            <td style="border: 2px solid #dbddff; font-size: 14px;" colspan="2">
                    Phân trang:
                    <asp:DropDownList ID="cboPageSize" 
                        runat="server" AutoPostBack="True" 
                        Width="45px" 
                        Height="20px" 
 
                        style="margin-right: 0px; margin-left: 0px;" 
                        CssClass="style9" Font-Size="13px" 
                        onselectedindexchanged="cboPageSize_SelectedIndexChanged">
                        <asp:ListItem Value="1">1</asp:ListItem>
                        <asp:ListItem Selected="True">5</asp:ListItem>
                        <asp:ListItem>10</asp:ListItem>
                        <asp:ListItem>20</asp:ListItem>
                        <asp:ListItem>30</asp:ListItem>
                        <asp:ListItem>50</asp:ListItem>
                    </asp:DropDownList>
                </td>
        </tr>
    </table>
    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
